{
  "properties" : { },
  "id" : "5f536a8f754d4babb18435fa54fca4fe",
  "script" : null,
  "groupId" : "a429965ae8fe4532916947ca2b658750",
  "name" : "查看监控画面",
  "createTime" : null,
  "updateTime" : 1741279185483,
  "lock" : null,
  "createBy" : null,
  "updateBy" : "管理员",
  "path" : "video.m3u8",
  "method" : "GET",
  "parameters" : [ {
    "name" : "id",
    "value" : "10001",
    "description" : null,
    "required" : true,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import java.util.Scanner
import java.io.FileReader
import java.io.File
import response;
import request;
import log;

var restText = '';
var endText = '';

var fileUrl = '/workspace/my_boot/web-manage/src/static/video/'+id+'.m3u8';

if(!new File(fileUrl).exists()){
    return '未开启'
}

try (Scanner sc = new Scanner(new FileReader(fileUrl))) {
    while (sc.hasNextLine()) {
        var line = sc.nextLine();
        if(line.endsWith('.ts')){
            restText += 'http://127.0.0.1:18082/video/' + line + '' + '\n';
            endText = line;
        } else {
            restText += line + '\n';
        }
        log.info(line);
    }
}
response.setHeader('Accept-Ranges', 'bytes');
response.setHeader('Content-Type', 'application/vnd.apple.mpegurl');

return response.download(restText.getBytes(), 'video.m3u8')